<?php
require_once("./include/download_data.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh" xml:lang="zh">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet"  type="text/css" href="css/common.css" />
	<title><?php echo $menu_download; ?></title>
	<script language="javascript"  type="text/javascript">
		document.onmousemove = mouseMove;
		var mousePos;
		var id = 0;
		function mouseCoords(ev)
		{
			if(ev.pageX || ev.pageY)
			{
				return {x:ev.pageX, y:ev.pageY};
			}
			return {x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,y:ev.clientY + document.body.scrollTop - document.body.clientTop};
		}

		function mouseMove(ev){
			ev = ev || window.event;
			mousePos = mouseCoords(ev);//使用mousePos.x和mousePos.y分别获取横纵坐标
		}
		function show(i,out)
		{
			if (id == i && document.getElementById(out).style.display=="block")
				return ;

			id = i;
  		  	var ob=document.getElementById(i);
    		document.getElementById(out).innerHTML=ob.innerHTML;
   		 	document.getElementById(out).style.left=mousePos.x + 20 + "px";
    		document.getElementById(out).style.top=mousePos.y+"px";
    		document.getElementById(out).style.display="block";
    		if (ob.innerHTML.length > 150)
    			document.getElementById(out).style.width = "500px";
		}
		function hid(out)
		{ 
    		document.getElementById(out).style.display="none";
		}
	</script>
	<style type="text/css">h3{font-size:15px}</style>
</head>
<body>
	<div id="intraduce" style="display:none;position:absolute;background-color:black;color:white;padding:10px 20px 20px 20px;">
	</div>
	<table align="center" style="width:<?php echo $width;?>;font-size:15px">
		<tr>
			<td><?php require_once("header.php"); ?></td>
		</tr>
		<tr>
			<td style="padding:10px 20px 0px 20px;" valign="top">
				<div class="download_list">
				<table style="width:100%;" cellspacing="0px" cellpadding="0px">
					<tr>
						<td colspan="6" style="font-size:15px;color:white;background-color:#555555;padding:5px 0px 5px 10px;height:25px; font-weight:bold">下载列表</td>
					</tr>
					<tr style="color:purple">
						<td style="padding:5px 0px 0px 10px">
							<h3>文件名</h3>
						</td>
						<td style="padding:5px 0px 0px 10px">
							<h3>文件大小</h3>
						</td>
						<td style="padding:5px 0px 0px 10px">
							<h3>上传人</h3>
						</td>
						<td style="padding:5px 0px 0px 10px">
							<h3>上传时间</h3>
						</td>
						<td style="padding:5px 0px 0px 10px">
							<h3>下载次数</h3>
						</td>
						<td style="padding:5px 0px 0px 10px">
							<h3>操作</h3>
						</td>
					</tr>
					<?php
						foreach($PageArray["filelist"] as $Object){
					?>
					<form action="" method="post">
						<input type="hidden" name="fid" value="<?php echo $Object->id; ?>" />
						<div id="<?php echo $Object->id;?>" style="display:none;">
							<p style="color:white">
								[<?php echo $Object->filename;?>]简介
							</p>
							<p>
								<?php echo $Object->intraduce?>
							</p>
						</div>
						<tr class="download_listitem">
						<td style="padding:0px 0px 0px 10px" onmouseover="show('<?php echo $Object->id;?>','intraduce')" onmouseout="hid('intraduce')">
							<?php echo $Object->filename;?>
						</td>
						<td style="padding:0px 0px 0px 10px">
							<?php echo sprintf("%.2fkB", $Object->size/1024);?></td>
						<td style="padding:0px 0px 0px 10px">
							<?php echo $Object->user;?></td>
						<td style="padding:0px 0px 0px 10px">
							<?php echo $Object->time;?></td>
						<td style="padding:0px 0px 0px 20px">
							<?php echo $Object->downcnt;?></td>
						<td style="padding:0px 0px 0px 10px">
							<input type="submit" value="点击下载" name="download" /></td>
						</tr>
					</form> 
					<?php }?>
				</table>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<?php require_once("footer.php");?></td>
			</tr>
	</table>
</body>
</html>

<?php 
/*
php.ini
apache.ini
file_uploads:
upload_tmp_dir:
upload_max_filesize:
post_max_size:
max_input_time:
memory_limit:
max_execution_time:
*/
?>